UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7UtSHMVWuRS9Vmj2WRyVe79YYk7NdhH8ii/Dr9jrwK4='
WHERE
key_id = 'cee93d1df4686420178c8fd2b31ea0f931b3283090b969aaffaa2c12cd32a65d'
AND (
token = '7UtSHMVWuRS9Vmj2WRyVe79YYk7NdhH8ii/Dr9jrwK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)