UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u7wT/vDhWgYfPau8we8J2AOB+vQdVUHLM29WpX0ufHA=' 
WHERE 
  key_id = 'c010c9022feaa9f013671505c18b3448c4069ac1307dd5d7ce3e102ffb7f2889' 
  AND (
    token = 'u7wT/vDhWgYfPau8we8J2AOB+vQdVUHLM29WpX0ufHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033