UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lgICG+xPyhO0vMz8ksZm5WOnHUdPPiI3rbaq5cPPGg8=' 
WHERE 
  key_id = 'd04f47c99ba9d72ef3ec1d0d7c93216ade38d22755e3fac77ac435eb63b58259' 
  AND (
    token = 'lgICG+xPyhO0vMz8ksZm5WOnHUdPPiI3rbaq5cPPGg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019