UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5JVboyKRZQW7K+oyBSqiFLMtCUJ6+tQHDO3z+rSVUV8='
WHERE
key_id = '9f7d7e617e0b0f6e5d0d1f4a9363866af5746673eef2f9beecef35e139245211'
AND (
token = '5JVboyKRZQW7K+oyBSqiFLMtCUJ6+tQHDO3z+rSVUV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)