UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lbCDVNiF8xQhpzdPe3TJCVWbJYoLJWNek/ZVOxLTy2o=' 
WHERE 
  key_id = 'abdee8bacd182b9d0f589f2a4ae07155d453695adaab6e515cb58169f5a839bc' 
  AND (
    token = 'lbCDVNiF8xQhpzdPe3TJCVWbJYoLJWNek/ZVOxLTy2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051