UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w11Nx/3DBRjQABNVcZBDz3QGBsmQs1I7hby65bheKmg=' 
WHERE 
  key_id = 'a530cfbedfcac0761c823313e031b9ef5367825d027d7eeeb44d5c7140c94cdb' 
  AND (
    token = 'w11Nx/3DBRjQABNVcZBDz3QGBsmQs1I7hby65bheKmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029