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