UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxxeWmpm3XZFe2u8Z0BweFZ4ty3/Bn/yOfOoSXAug9M=' 
WHERE 
  key_id = '89e17bfa07e4e58bed41ad8dcdb25f2f419434449268a45148a09143f3c611a8' 
  AND (
    token = 'GxxeWmpm3XZFe2u8Z0BweFZ4ty3/Bn/yOfOoSXAug9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044