UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U6rsqse8/kyavRqJNUg62wrdymkEiwxI7xpyxc4xXqw=' 
WHERE 
  key_id = '639deda6e1f378b4c4cb92029045245a7dffd79f183458fbf8e05b8a3e4ec843' 
  AND (
    token = 'U6rsqse8/kyavRqJNUg62wrdymkEiwxI7xpyxc4xXqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016