UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HkrLkLuNwcU/OfQTf379LYs4M1sINhKpGYIWJKqJV8=' 
WHERE 
  key_id = '46d1d4597c27c992fac9319aa3be75b87a0933d2376165a201c9dbf433fda007' 
  AND (
    token = '/HkrLkLuNwcU/OfQTf379LYs4M1sINhKpGYIWJKqJV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028