UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJT7TgSVd9oSqkkAfXuF0/yVoFH/kHQIORjsEIw3Zc0='
WHERE
key_id = '68247becc8f9264f68366c39e40d3a91b08ae59c384ba7209ab1fb83d4782254'
AND (
token = 'ZJT7TgSVd9oSqkkAfXuF0/yVoFH/kHQIORjsEIw3Zc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)