UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jl+HgmwIgzA7mGC6A8xMGmrE7CvJQaQ74Zkw6lYZA0='
WHERE
key_id = '3106a9ed467b1cc72f27a0f5e41521507760a3c1cbcb2ea8cf8c3ef48819d5ff'
AND (
token = '3jl+HgmwIgzA7mGC6A8xMGmrE7CvJQaQ74Zkw6lYZA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)