UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xtE+E3kH1pZkgi5EVQ7/XU2UCl59Vn09FJemVIw25ZY='
WHERE
key_id = 'c9a273bfc535d0f02de8a3ce01609cea98eb099f8a477e48cf66e6ba8a40e87c'
AND (
token = 'xtE+E3kH1pZkgi5EVQ7/XU2UCl59Vn09FJemVIw25ZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)