UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZZti5kBqQKqOdPtox7ApIBI/s1JqDOv2KOSomNsTkdA=' 
WHERE 
  key_id = '4e9934547e9c0385452d1c5765cef8ad3159beb963fa594ef6718f2431655608' 
  AND (
    token = 'ZZti5kBqQKqOdPtox7ApIBI/s1JqDOv2KOSomNsTkdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025