UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DYLTvXtOLJQ0+NuF8w7hP1Y8xZ33tE5dwUYcQiwM7zE=' 
WHERE 
  key_id = '9125a77544dff7efa52bfede2348ae501ac519d4f49dd2259a517921b2347a56' 
  AND (
    token = 'DYLTvXtOLJQ0+NuF8w7hP1Y8xZ33tE5dwUYcQiwM7zE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032