UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DMOJqrSAWEdS4UhUHEv3ZbaZb68g65+aiDm8XcrYn2A=' 
WHERE 
  key_id = '597af57d9973cc0f89cc96ba606b702034238845d82eb2b1744a248ad32abbdc' 
  AND (
    token = 'DMOJqrSAWEdS4UhUHEv3ZbaZb68g65+aiDm8XcrYn2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022