UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rOH7v/9IUWcMYBr4Wfthp9Q8mZ3mhUBA/8wBQatv2mw=' 
WHERE 
  key_id = '200df37b416a7d76110ea93b8e35a6eff3cff601c59cceba21619fd76ae76589' 
  AND (
    token = 'rOH7v/9IUWcMYBr4Wfthp9Q8mZ3mhUBA/8wBQatv2mw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048