UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmG+ppjRoybFIRD0CS3Q7SOE+GV029IuQ718824W/P0=' 
WHERE 
  key_id = '9a48eb656c1ce540b1cd103917a17c9e79c4613e30217da8d2822acf9ffd67e8' 
  AND (
    token = 'zmG+ppjRoybFIRD0CS3Q7SOE+GV029IuQ718824W/P0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036