UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S//Ei6eiUWIsoy5f7ST2nyXqbBZk8Z1IW4MabsaUi/M=' 
WHERE 
  key_id = '6d42ff564d52b69a23e71bdae367141e9fea691a244da5f107ba278840afb981' 
  AND (
    token = 'S//Ei6eiUWIsoy5f7ST2nyXqbBZk8Z1IW4MabsaUi/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017