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