UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ZSxA5j0NLZG/Ylpez8IQR5CyXdfpQnjBTiyE2zw0CA='
WHERE
key_id = '21b4ccd7d0dbd1ed568ec46d8856758e596d9a27aa5a9eda05ac80ee430763cb'
AND (
token = '9ZSxA5j0NLZG/Ylpez8IQR5CyXdfpQnjBTiyE2zw0CA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)