UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I89AqUXXNWdlXLFyCVZCiu9BKpVVg5lFDanuQZjLb4E=' 
WHERE 
  key_id = '98ec20eaea67baa959d1d298acfa0c4fc264554e992b762a08005ca86609b896' 
  AND (
    token = 'I89AqUXXNWdlXLFyCVZCiu9BKpVVg5lFDanuQZjLb4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00090