UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/D208fA/ZktKuMekvN4mafcSZhB7hHR4Blyh6lCwHgo=' 
WHERE 
  key_id = 'ba679e290468bc3439f0a914c84b96610b609a06fcfcd8d466c7f8d0167777a9' 
  AND (
    token = '/D208fA/ZktKuMekvN4mafcSZhB7hHR4Blyh6lCwHgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048