UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91DDXW5edJwUZ5/K2ouDQ0pXN50Jt/0N6ix02eQirwU='
WHERE
key_id = 'fe4d89dda6d58c81251b96639cf77a20dc71b884fac721190d5a5ca400999abc'
AND (
token = '91DDXW5edJwUZ5/K2ouDQ0pXN50Jt/0N6ix02eQirwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)