UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uIKk/LaaUG+Dl9P847dkCv1q4jV+vPLYJl+JWJJpjpE=' 
WHERE 
  key_id = '5389d43ab5c75b3623208a1fe352492fb0dd31cd016cfcc06c6e911b6285ddc6' 
  AND (
    token = 'uIKk/LaaUG+Dl9P847dkCv1q4jV+vPLYJl+JWJJpjpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054