UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G26fSF/NiXN7F7xbC5wBNsYizUcqUk6ton4StDeznm4='
WHERE
key_id = '7fb9c70f49bfb8767e6d54eccf7a1f2547390bbb2ad3cc32d1f93bf46928ca68'
AND (
token = 'G26fSF/NiXN7F7xbC5wBNsYizUcqUk6ton4StDeznm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)