UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MKCcUJm1/hsZCKCeTKJ0tiOgsxMAb8s2tgL4sB3hN18='
WHERE
key_id = '9654335a42a70693e31053e14359d8a0c07aad27113b59fdbfb0ed27d48452df'
AND (
token = 'MKCcUJm1/hsZCKCeTKJ0tiOgsxMAb8s2tgL4sB3hN18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)