UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HWqZ3MDCXRLh1+ILEutuR4jy6qHWHYm5srAyEoCvl8='
WHERE
key_id = '732df0050803306e4cfc62cc5b315ae8da65599667194e13fd3cf554c9da7d49'
AND (
token = '7HWqZ3MDCXRLh1+ILEutuR4jy6qHWHYm5srAyEoCvl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)