UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mKGm+UI/J1cviUbwFXG49MjPAxMCe6vfdEUUO+rKBnE=' 
WHERE 
  key_id = '9b3fda272b6f6a9bd47196ce3a97a99e5057453fc2c9fa9b2dbe0b6c1217c40e' 
  AND (
    token = 'mKGm+UI/J1cviUbwFXG49MjPAxMCe6vfdEUUO+rKBnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029