UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GAGVExBLUbmHR2IPniGMWkjrxjVoX90jd4HeSXf6H7U=' 
WHERE 
  key_id = 'ca9eaf9b0e3389e9cab4f7a55bfbee40a2419ac1265c1caecea37cc863f1f4c9' 
  AND (
    token = 'GAGVExBLUbmHR2IPniGMWkjrxjVoX90jd4HeSXf6H7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043