UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8yXIF+r49xpIUKPbMee/HcvmkB93XLaqfK6vkGG033o='
WHERE
key_id = '9e2f470ee4433391dad50c70a4ab6eaa4065d51261c1b87d58361c7b84e6c7a3'
AND (
token = '8yXIF+r49xpIUKPbMee/HcvmkB93XLaqfK6vkGG033o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)