UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q9RX2pYggom+FOc8JWF5NP5K324dWmbl88pQjKvF/ZI=' 
WHERE 
  key_id = '37dc6e6834bcd6f28aea73f38e178efcc3e22ed814d630e3b4cbb0ad85ece10e' 
  AND (
    token = 'Q9RX2pYggom+FOc8JWF5NP5K324dWmbl88pQjKvF/ZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021