UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ko2kxEUa4JFP3d5B7GhN8lxUmzUrlhZPKAbWSyj28Ac=' 
WHERE 
  key_id = '9f09127a45a8e3095f326f620d472e1a550201c9c8576340cf5d05a597e9e984' 
  AND (
    token = 'ko2kxEUa4JFP3d5B7GhN8lxUmzUrlhZPKAbWSyj28Ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035