UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p+hFx3jLTqhIBUG98xOnVRdFEW48HO3OheQwR2d92bI=' 
WHERE 
  key_id = '5065b7ce1c33a14dc698fceb728b550fa5f63a0cbd09f5a497f9d64faba5db4a' 
  AND (
    token = 'p+hFx3jLTqhIBUG98xOnVRdFEW48HO3OheQwR2d92bI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034