UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yO+qiXzZdYipognh6gx+p1rPzZbJbTikYGnpQ1c4YS4='
WHERE
key_id = 'a4d36ca19fc4d71869f903938a22c0104fab8c5b80a8fccd19cae4e261901d71'
AND (
token = 'yO+qiXzZdYipognh6gx+p1rPzZbJbTikYGnpQ1c4YS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)