UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TCZN6vjeUgw3tNeEK+dSrV/xJLtQJupXPNxlV8pfjtM='
WHERE
key_id = '085c5b4691621f1a7485f0cf055ce187e169ce2aff58577f1e9f9341977b9083'
AND (
token = 'TCZN6vjeUgw3tNeEK+dSrV/xJLtQJupXPNxlV8pfjtM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)