UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOy3WDfRe3nJzeGGiH6Q/6PBK2EnO6rgkca2lT8KCXw='
WHERE
key_id = '6ba80cd07902ee7e93918e82ac8bffa4c35d0064341347041d847d5a4e191670'
AND (
token = 'lOy3WDfRe3nJzeGGiH6Q/6PBK2EnO6rgkca2lT8KCXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)