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

Query time 0.00030