UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aki+W/6/2LNebFB9nGQec75WjZZmZYuEKo7En77La1o='
WHERE
key_id = '3bcd0469047c2d7e67a6c922ad66eceef5d15a5eb17257b2ee9a14a802adaf7f'
AND (
token = 'aki+W/6/2LNebFB9nGQec75WjZZmZYuEKo7En77La1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)