UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvMFf4TIprlbBBH5L25ueA0pyz+tKMP9H+0UbM7wjRc=' 
WHERE 
  key_id = '088f8068688cec3abb1ec1b7964eb7fc0e06b2ab028cd559f6931689b3b662f2' 
  AND (
    token = 'dvMFf4TIprlbBBH5L25ueA0pyz+tKMP9H+0UbM7wjRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026