UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XoKBvqgWqD8NPmkSX8MEOAOmJsnqdQroKUB8jYdZ8iY='
WHERE
key_id = '492826b8daec4f338edff0d0990672ee2984ec4218cd53c64ee2c47adabb9ef7'
AND (
token = 'XoKBvqgWqD8NPmkSX8MEOAOmJsnqdQroKUB8jYdZ8iY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)