UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vzzlYmLOLVo1MYS3JL1NaAfy/CRFig3orZuBPkuwkgA='
WHERE
key_id = '8018324506573f6d0e3ebbf4833ea547496bc67541b81bbf619c6cd5ddb11304'
AND (
token = 'vzzlYmLOLVo1MYS3JL1NaAfy/CRFig3orZuBPkuwkgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)