UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd69F/3QnXraMfrxXif5P/9Tln3u1P1b9jcM0mcrfWLA='
WHERE
key_id = '61a08ddfbe12b5f831847283e7464fe31f3576399c61238ca1d2d71dcef5a386'
AND (
token = 'd69F/3QnXraMfrxXif5P/9Tln3u1P1b9jcM0mcrfWLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)