UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PmaRVFcoDqnUuUVlBbcjhybVlW5XzK+i2QCIDrzTqTE='
WHERE
key_id = 'f9657298409c5b91212c7a0384789c772d6595135171a2caf1bb35b5f5e42cd7'
AND (
token = 'PmaRVFcoDqnUuUVlBbcjhybVlW5XzK+i2QCIDrzTqTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)