UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LgecqoYEJH7PDTAdTRyoPSHW2bzfzdhPaAahQQpapbw=' 
WHERE 
  key_id = '3e165141e3f0724a9360b7cddc3730e8294e80e4bf3c354e34b5af1419afcab3' 
  AND (
    token = 'LgecqoYEJH7PDTAdTRyoPSHW2bzfzdhPaAahQQpapbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016