UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ye5oXbmbmKzIfdWvw9UV3netbx6Ljg7tgb7tcgGZ8Pg='
WHERE
key_id = '529fa6bab54480707dce636a219db2ee0ea0d4be0026656f55acc09f2573ffe1'
AND (
token = 'Ye5oXbmbmKzIfdWvw9UV3netbx6Ljg7tgb7tcgGZ8Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)