UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZzADX+e+st4AvVXXqDdO9IESlCVAKbruSQnXS8IZ67w=' 
WHERE 
  key_id = '35d5e0c6b4979e20dc237a12562c76483d4fd56c5698e1170dce9814749b6d48' 
  AND (
    token = 'ZzADX+e+st4AvVXXqDdO9IESlCVAKbruSQnXS8IZ67w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047