UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ua6QFL1YOQbyp5mzQeb63oyOM3iJ97wU1MDX5sJKf1o=' 
WHERE 
  key_id = '49a493db78dbc7cd6f49962ff35b4af3c14648f038bcad2a0f06c5ca706e05cb' 
  AND (
    token = 'Ua6QFL1YOQbyp5mzQeb63oyOM3iJ97wU1MDX5sJKf1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032