UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd/YMJueYjcQNyXabhQhZcqpZdTTKeGHC5Vqemln8WdY='
WHERE
key_id = '383f626a98468b4cde69c5de0f56970bed0c51c3961fd4e13210d176f39765b4'
AND (
token = 'd/YMJueYjcQNyXabhQhZcqpZdTTKeGHC5Vqemln8WdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)