UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hK4s6d9hr0R+qLbZVQHDrGlJCzmL0AbQmufXbUXi0NM=' 
WHERE 
  key_id = 'f33cd007fc8684fbfe944d5de88866a9a89660bda889d80557848fb155dfc609' 
  AND (
    token = 'hK4s6d9hr0R+qLbZVQHDrGlJCzmL0AbQmufXbUXi0NM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026