UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T97a0ZG3pRmDad5Tv3bBJRiwGZtXjYklZDiy2qcfiiQ='
WHERE
key_id = '0d0e626cb6f27dadf5cac133dcb593313e50584e6802d7049454e8bca6be470e'
AND (
token = 'T97a0ZG3pRmDad5Tv3bBJRiwGZtXjYklZDiy2qcfiiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)