UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fz6iFXjhYJQCtWyd8VA2abvtg+evYUrO8KVjYwA/vpw=' 
WHERE 
  key_id = 'a95d5abb491d7c0e0bcd9269191944093906426323889080839a117c8a6011cb' 
  AND (
    token = 'Fz6iFXjhYJQCtWyd8VA2abvtg+evYUrO8KVjYwA/vpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028