UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'slrKDFaF+cqz8ZAqSTEGxWljAeUke4FHCIH1ADXqu9U=' 
WHERE 
  key_id = '54084c9a5c5438f18c6b92c6a3b9368cec994f7ee5a10275bd625611ac3d18c8' 
  AND (
    token = 'slrKDFaF+cqz8ZAqSTEGxWljAeUke4FHCIH1ADXqu9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040