UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZNjpFhCD9krnA7pmBtGTHJtyGon/wAXmaXRi/FS2SWc=' 
WHERE 
  key_id = 'fe9799d6ade7ade6f2320c261362bfd31fb94b84cdb5c0b52ec5581126ffe88e' 
  AND (
    token = 'ZNjpFhCD9krnA7pmBtGTHJtyGon/wAXmaXRi/FS2SWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031