UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MvCsKMsiPvgyR5OpFiBY2T54LmQeH5FcueTCGnRC18='
WHERE
key_id = 'd92a130d8959535270dab13bcbc1de662fd1b76afa6db5de9df0749e299b91e6'
AND (
token = '8MvCsKMsiPvgyR5OpFiBY2T54LmQeH5FcueTCGnRC18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)