UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XXUs2ey280t5qEwJQ9u/nsDDudgUSSVpWLzAQFN24KY=' 
WHERE 
  key_id = '9c424eed4272625a6155e66be0bbff4e0e330063e421472b4de6ad1d2eec6cde' 
  AND (
    token = 'XXUs2ey280t5qEwJQ9u/nsDDudgUSSVpWLzAQFN24KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030